local assets =
{
    -- Asset("ANIM", "anim/panda_fisherman_supply_pack.zip"),
    Asset( "IMAGE", "images/inventoryimages/npc_item_goldnugget_coin.tex" ),  -- 背包贴图
    Asset( "ATLAS", "images/inventoryimages/npc_item_goldnugget_coin.xml" ),

    Asset( "IMAGE", "images/inventoryimages/npc_item_coin_1.tex" ),  -- 背包贴图
    Asset( "ATLAS", "images/inventoryimages/npc_item_coin_1.xml" ),
    
    Asset( "IMAGE", "images/inventoryimages/npc_item_coin_2.tex" ),  -- 背包贴图
    Asset( "ATLAS", "images/inventoryimages/npc_item_coin_2.xml" ),
    
    Asset( "IMAGE", "images/inventoryimages/npc_item_coin_3.tex" ),  -- 背包贴图
    Asset( "ATLAS", "images/inventoryimages/npc_item_coin_3.xml" ),

    Asset( "IMAGE", "images/inventoryimages/npc_item_coin_4.tex" ),  -- 背包贴图
    Asset( "ATLAS", "images/inventoryimages/npc_item_coin_4.xml" ),

}
local function GetStringsTable()
    return TUNING.NPC_CHAT_TABLE[ type(TUNING.__NPC_LANGUAGE)=="function" and TUNING.__NPC_LANGUAGE() or TUNING.__NPC_LANGUAGE ] ["npc_item_goldnugget_coin"] or {}
end

local function fn()
    TheSim:LoadPrefabs({"quagmire_coin1","quagmire_coin2","quagmire_coin3","quagmire_coin4"})
    local inst = CreateEntity()

    inst.entity:AddTransform()
	inst.entity:AddNetwork()
    inst.entity:AddAnimState()

    inst.AnimState:SetBank("quagmire_coins")
    inst.AnimState:SetBuild("quagmire_coins")
    inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh")
    -- inst.AnimState:PlayAnimation("idle")
    inst.AnimState:PlayAnimation("bounce1",true)
    -- if id > 1 then
    --     inst.AnimState:OverrideSymbol("coin01", "quagmire_coins", "coin0"..tostring(id))
    --     inst.AnimState:OverrideSymbol("coin_shad1", "quagmire_coins", "coin_shad"..tostring(id))
    -- end
    inst:AddTag("npc_item_goldnugget_coin")
    
	MakeInventoryPhysics(inst)
    MakeInventoryFloatable(inst, "med", nil, 0.75)

    inst.entity:SetPristine()
    if not TheWorld.ismastersim then
        return inst
    end
    -- inst:AddComponent("npc_base_lib")
    -- inst:AddComponent("npc_everything_data")

    inst:AddComponent("inspectable") --可检查组件
    
    inst:AddComponent("inventoryitem")
    inst.components.inventoryitem:ChangeImageName("npc_item_goldnugget_coin")
    inst.components.inventoryitem.imagename = "npc_item_goldnugget_coin"
    inst.components.inventoryitem.atlasname = "images/inventoryimages/npc_item_goldnugget_coin.xml"
    
	inst.components.inventoryitem.cangoincontainer = true

    inst:AddComponent("named")
    inst.components.named:SetName(GetStringsTable().name)
    STRINGS.CHARACTERS.GENERIC.DESCRIBE[string.upper("npc_item_goldnugget_coin")] = GetStringsTable().inspect_str  --人物检查的描述

    inst:AddComponent("tradable")

    inst:AddComponent("stackable")
    inst.components.stackable.maxsize = TUNING.STACK_SIZE_TINYITEM

    inst:ListenForEvent("on_landed",function()
        if inst:IsOnOcean(false) then
            inst.AnimState:PlayAnimation("idle")
        else
            inst.AnimState:PlayAnimation("bounce1",true)
        end
    end)
    inst:DoTaskInTime(0,function()
        inst:PushEvent("on_landed")
    end)


    return inst
end

return Prefab("npc_item_goldnugget_coin", fn,assets)